<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>我的游戏成就</title>
  <style>
    .container {
      width: 80%;
      margin: 0 auto;
      padding: 20px;
    }
    .header {
      text-align: center;
      margin-bottom: 30px;
    }
    .achievement-wall {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 20px;
      margin-top: 20px;
    }
    .achievement-card {
      background-color: #f5f5f5;
      border-radius: 10px;
      padding: 20px;
      text-align: center;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .empty-message {
      text-align: center;
      padding: 50px;
      font-size: 1.2em;
      color: #666;
    }
  </style>
</head>
<body>
<div class="container">
  <div class="header">
    <h1>我的游戏成就墙</h1>
    <%
      SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日HH:mm");
      String currentTime = sdf.format(new Date());
    %>
    <p>当前时间: <%= currentTime %></p>
  </div>

  <%
    String[] achievements = {
            "首次登录",
            "连续签到7天",
            "击败Boss",
            "好友邀请达人",
            "完成新手教程",
            "获得1000金币"
    };
  %>

  <div class="achievement-wall">
    <%
      if (achievements != null && achievements.length > 0) {
        for (String achievement : achievements) {
    %>
    <div class="achievement-card">
      <p style="font-size: 2em;">🏆</p>
      <p><%= achievement %></p>
    </div>
    <%
      }
    } else {
    %>
    <div class="empty-message">
      你还没有任何成就，快去闯关吧！
    </div>
    <%
      }
    %>
  </div>
</div>
</body>
</html>